﻿namespace Hidistro.UI.SaleSystem.Tags
{
    using Hidistro.Membership.Context;
    using System;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class Common_AliOHPaymentTypeSelect : WebControl
    {
        protected override void Render(HtmlTextWriter writer)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
            StringBuilder builder = new StringBuilder();
            builder.Append("<button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">请选择一种支付方式<span class=\"caret\"></span></button>");
            builder.AppendLine("<ul id=\"selectPaymentType\" class=\"dropdown-menu\" role=\"menu\">");
            if (masterSettings.EnableAliOHOffLinePay)
            {
                builder.AppendLine("<li><a href=\"#\" name=\"-1\">线下付款</a></li>");
            }
            if (masterSettings.EnableAliOHPodPay)
            {
                builder.AppendLine("<li><a href=\"#\" name=\"0\">货到付款</a></li>");
            }
            if (masterSettings.EnableAliOHAliPay)
            {
                builder.AppendLine("<li><a href=\"#\" name=\"-4\">支付宝手机网页支付</a></li>");
            }
            if (masterSettings.EnableAliOHShengPay)
            {
                builder.AppendLine("<li><a href=\"#\" name=\"-5\">盛付通手机网页支付</a></li>");
            }
            builder.AppendLine("</ul>");
            writer.Write(builder.ToString());
        }
    }
}

